<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>21-根据位置返回字符</title>
	</head>
	<body>
		<script type="text/javascript">
			//charAt()
			var str = 'abcdefg';
			console.log(str.charAt(2));
			console.log(str.charCodeAt(0));//97
			console.log(str.charCodeAt(1));//98
			
		</script>
	</body>
</html>
